<!--
 * @Author: Wushiqi
 * @Descripttion: 异步编程
 * @Date: 2021-04-27 16:12:25
 * @LastEditor: Wushiqi
 * @LastEditTime: 2021-04-27 16:17:57
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 回调函数
    function f1(callback){
      console.log('aaa');
      setTimeout(function () {
      　　// f1的任务代码
        console.log('f1')
    　　callback();
      }, 5000);
      console.log('bbb');
    }
    function f2() {
      console.log('f2')
    }
    f1(f2)
  </script>
</body>
</html>